dojo.require("dojo.fx");

function divCollapser() 
{	
	this.collapsed = new Object();	
	
	this.toggle = function(div) 
	{
		if (this.collapsed[div] == null) this.collapsed[div] = false;
				
		if (this.collapsed[div]) dojo.fx.wipeIn({ node: div, duration:500 }).play();
		else dojo.fx.wipeOut({ node: div, duration:500 }).play();
		
		this.collapsed[div] = !this.collapsed[div];
	}
	
	/**
	* if an item has not been toggled before, it will not be collapsed.
	*/	
	this.isCollapsed = function(div)
	{
		if (this.collapsed[div] != null){
			return this.collapsed[div];
		} else {
			this.collapsed[div] = false;
			return this.collapsed[div];
		}
	}
	
	this.collaps = function(div)
	{
		if (this.collapsed[div] != null){
			if (this.collapsed[div]) return;
			else this.toggle(div);
		} else this.toggle(div);	
	}
	
	this.unCollaps = function(div)
	{
		if (this.collapsed[div] != null){
			if (!this.collapsed[div]) return;
			else this.toggle(div);
		} else {
		this.collapsed[div] = true;
		this.toggle(div);
		}
	}
	
}